/**
 * @file Service_Communication.h
 * @author Glorill 1615688664@qq.com
 * @brief UART以及CAN通信相关
 * @version 0.1
 * @date 2022-02-04
 * 
 * @copyright Copyright (c) 2022
 * 
 */

#ifndef  _SERVICE_COMMUNICATE_H_
#define  _SERVICE_COMMUNICATE_H_

/* Includes ------------------------------------------------------------------*/

#include "System_Config.h"

#ifdef  __cplusplus
extern "C"{
#endif

/* Exported macros -----------------------------------------------------------*/

/* Exported types ------------------------------------------------------------*/

//CAN message data type(Communication Object/标准数据帧)
typedef struct
{
  uint16_t ID;
  uint8_t DLC;
  uint8_t Data[8];
} COB_TypeDef;
typedef struct
{
    uint8_t port_num;
    int16_t len;
    void *address;
} USART_COB;

/* Exported variables --------------------------------------------------------*/

/* Exported function declarations --------------------------------------------*/

void User_CAN1_RxCpltCallback(CAN_RxBuffer *CAN_RxMessage);
void User_CAN2_RxCpltCallback(CAN_RxBuffer *CAN_RxMessage);
void Service_Communication_Init(void);

#ifdef  __cplusplus
}
#endif

#endif  

/************************ COPYRIGHT(C) USTC-ROBOWALKER **************************/
